object Tuples {
  def main(args: Array[String]): Unit = {
    //定义 tuple
    var t1 = ("zs","wuhan",50)
    var t2 = new Tuple4("zs","wuhan",50,true)
    var t3 = new Tuple4[String,String,Int,Boolean]("zs","wuhan",50,true)

    //遍历tuple
//    t3.productIterator.foreach { s =>
//      println(s)
//    }

    //tuple的数据进行变换
//    var t33 = t3.productIterator.map {
//      x => x + "！"
//    }.foreach {
//      s => println(s)
//    }

    //tuple不能被修改
//    println(t3._3)

//    val(name,addr,age) = t1
//    println(name)
//    println(addr)
//    println(age)

    //动态的定义
    def mike = "mike" -> 5
    println(mike.getClass)
    //    println(mike._1)
    //    println(mike._2)
    val(v1,v2) = mike
    println(v1,v2)





  }

}
